home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
CMPLTPAS
/
GETEXT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-09-29
|
961b
|
23 lines
{->>>>GetExt<<<<-----------------------------------------------}
{ }
{ Filename : GETEXT.SRC -- Last Modified 9/29/88 }
{ }
{ Given a legal DOS file name with an extention, this routine }
{ returns the extension. If the file has no extension, it }
{ returns an empty string. }
{ }
{ From: COMPLETE TURBO PASCAL 5.0 by Jeff Duntemann }
{ Scott, Foresman & Co., Inc. 1988 ISBN 0-673-38355-5 }
{--------------------------------------------------------------}
FUNCTION GetExt(FileName : String80) : String80;
VAR
DotPos : Integer;
BEGIN
DotPos := Pos('.',FileName);
IF DotPos = 0 THEN GetExt := '' ELSE
GetExt := Copy(FileName,DotPos,(Length(FileName)-DotPos)+1);
END;